<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="sp" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title><sp:message code="common.userCenter.title" /></title>
</head>
<body>
  <form id="userForm" action="/admin/userCenter/modifyPassword.dhtml" method="post">
    <table class="form01">
      <caption>修改密码</caption>
      <c:choose>
        <c:when test="${message.info != null }">
          <tr>
            <td colspan="2"><sp:message code="${message.info}" text="" /></td>
          </tr>
        </c:when>
        <c:otherwise>
          <tr>
            <td>旧密码</td>
            <td><input type="password" id="oldPwd" name="oldPassword" /><span id="oldPwdTip"></span></td>
          </tr>
          <tr>
            <td>密码</td>
            <td><input type="password" id="userPwd" name="user.pwd" /><span id="userPwdTip"></span></td>
          </tr>
          <tr>
            <td>重复密码</td>
            <td><input type="password" id="userRepwd" name="user.repwd" /><span id="userRepwdTip"></span></td>
          </tr>
          <tr>
            <td></td>
            <td><input type="submit" id="submit_user" class="button01" value="添加" /></td>
          </tr>
        </c:otherwise>
      </c:choose>
    </table>
  </form>
  <script type="text/javascript">
			$(document).ready(function() {
				// 表单验证
				// 表单验证
				var formCheck = $.formCheck();
				formCheck.regPasswordLimit("oldPwd", {
					onShow : "输入旧密码",
					onFocus : "密码由5-20个字母、数字、下划线组成",
					onError : "密码由5-20个字母、数字、下划线组成",
					onCorrect : "密码输入正确"
				}, 5, 20, true);
				formCheck.regPasswordLimit("userPwd", {
					onShow : "输入新密码",
					onFocus : "密码由5-20个字母、数字、下划线组成",
					onError : "密码由5-20个字母、数字、下划线组成",
					onCorrect : "密码输入正确"
				}, 5, 20, true);
				formCheck.regPasswordLimit("userRepwd", {
					onShow : "再次输入新密码",
					onFocus : "密码由5-20个字母、数字、下划线组成",
					onError : "密码由5-20个字母、数字、下划线组成",
					onCorrect : "再次密码输入正确"
				}, 5, 20, true);
				
				formCheck.formCheck("userForm");
			});
		</script>
</body>
</html>